﻿<UserControl x:Class="Starlight.SamplePlayer.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:src="clr-namespace:Starlight.SamplePlayer"
    Width="1000" Height="300">
    <Canvas
        Name="ParentCanvas">
        <Grid x:Name="PlayerGrid" ShowGridLines="False" Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="133"/>
                <ColumnDefinition Width="133"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="1" Grid.Column="0" Text="Status" FontWeight="Bold"></TextBlock>
            <TextBlock Grid.Row="1" Grid.Column="1" Text="Buffer Level" FontWeight="Bold"></TextBlock>
            <TextBlock Grid.Row="1" Grid.Column="2" Text="Position" FontWeight="Bold"></TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="0"  x:Name="StatusText" Text="{Binding CurrentState}"></TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="1" x:Name="BufferLevelText" Text="{Binding BufferingProgress}"></TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="2" x:Name="PositionText" Text="{Binding Position}"></TextBlock>
            
            <MediaElement HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" AutoPlay="False" x:Name="MediaPlayer">
            </MediaElement>
        </Grid>
        <Canvas Name="OverlayRect" Background="Black" Opacity="0" Canvas.ZIndex="20">
            <ProgressBar Name="BufferProgress" Width="30" Height="20" Value="{Binding BufferingProgress}" Minimum="0" Maximum="1"/>
        </Canvas>
        <Canvas Name="UnderlayRect" Background="Black" Opacity="1" Canvas.ZIndex="0" Canvas.Left="0" Canvas.Top="0">
        </Canvas>
        
    </Canvas>
</UserControl>
